import {Navigate, useLocation} from 'react-router';
import {ReactNode} from 'react';
const isSign = true;

export const AuthRoute = ({children}: {children: ReactNode}) => {
    const location = useLocation();
    return !isSign ? <Navigate to={'/login'} state={{from: location.pathname}} replace /> : <>{children}</>;
};
